const Router = require('koa-router');
const customerController = require('../controllers/customerController');
const auth = require('../middleware/auth');

const router = new Router({ prefix: '/api/v1/customers' });

// 所有接口都需要登录鉴权
router.post('/', auth, customerController.createCustomer);
router.get('/', auth, customerController.getCustomers);
router.get('/:id', auth, customerController.getCustomerById);
router.put('/:id', auth, customerController.updateCustomer);
router.delete('/:id', auth, customerController.deleteCustomer);
router.get('/:openid/goods',  customerController.getGoodsByCustomerOpenid);
module.exports = router;
